home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zoom 2
/
Zoom - Release 2 (1996)(Active Software)[!].iso
/
utilities
/
blankers
/
blitzblank_260
/
developer
/
blitzblanklib.doc
< prev
next >
Wrap
Text File
|
1995-05-14
|
24KB
|
780 lines
TABLE OF CONTENTS
blitzblank.library/--background--
blitzblank.library/BBL_AllocBitMap
blitzblank.library/BBL_AllocDBufBitMap
blitzblank.library/BBL_AllocRastPort
blitzblank.library/BBL_BlankDone
blitzblank.library/BBL_BlankMouse
blitzblank.library/BBL_CloneFirstScreen
blitzblank.library/BBL_CloseScreenSafe
blitzblank.library/BBL_CopyOriginalColors
blitzblank.library/BBL_CopyOriginalScreen
blitzblank.library/BBL_EndDBuf
blitzblank.library/BBL_FadeDown
blitzblank.library/BBL_FreeBitMap
blitzblank.library/BBL_FreeRastPort
blitzblank.library/BBL_GetDarkestPen
blitzblank.library/BBL_GetString
blitzblank.library/BBL_InitDBuf
blitzblank.library/BBL_ModuleRunning
blitzblank.library/BBL_RainbowPalette
blitzblank.library/BBL_RemainingTime
blitzblank.library/BBL_ScreenAvailable
blitzblank.library/BBL_SendMessage
blitzblank.library/BBL_ShowBitMap
blitzblank.library/BBL_UnBlankMouse
blitzblank.library/--background-- blitzblank.library/--background--
PURPOSE
This is the support-library for BlitzBlank-modules. These functions
handle the communication between BlitzBlank and the blankermodules.
Also, there are some additional functions, which may be of use for
some modules.
ALL modules MUST use the following functions:
- BBL_GetString()
- BBL_SendMessage()
- BBL_ModuleRunning()
- BBL_BlankDone()
Modules, which open their own screen, instead of getting one from
BlitzBlank (what most modules do), should use the following
functions in addition:
- BBL_BlankMouse()
- BBL_UnBlankMouse()
- BBL_CloseScreenSafe()
The other functions could be useful for your module. Check them out.
blitzblank.library/BBL_AllocBitMap blitzblank.library/BBL_AllocBitMap
NAME
BBL_AllocBitMap -- Allocate a bitmap.
SYNOPSIS
bitmap = BBL_AllocBitMap( width, height, depth, flags)
D0 D1 D2 D3
struct BitMap *BBL_AllocBitMap( ULONG, ULONG, ULONG, ULONG )
FUNCTION
Allocates a bitmap with the given width, height, depth and flags.
This function is V39-aware and will so call V39's AllocBitMap(),
if available. You will probably need this function in modules
with doublebuffering or hidden drawing.
INPUTS
width - Width of the bitmap in pixels.
height - Height of the bitmap in pixels.
depth - Number of planes in the bitmap.
flags - BMF_CLEAR to specify that the allocated raster should be
filled with color 0.
BMF_DISPLAYABLE to specify that this bitmap data should
be allocated in such a manner that it can be displayed.
Displayable data has more severe alignment restrictions
than non-displayable data in some systems.
BMF_INTERLEAVED tells graphics that you would like your
bitmap to be allocated with one large chunk of display
memory for all bitplanes. This minimizes color flashing
on deep displays. If there is not enough contiguous RAM
for an interleaved bitmap, graphics.library will fall
back to a non-interleaved one.
RESULTS
bitmap - Allocated and initialized bitmap or NULL, if the call failed.
SEE ALSO
BBL_FreeBitMap()
blitzblank.library/BBL_AllocDBufBitMap blitzblank.library/BBL_AllocDBufBitMap
NAME
BBL_AllocDBufBitMap -- Allocate a bitmap for double-buffering.
SYNOPSIS
bitmap = BBL_AllocDBufBitMap( screen )
A0
struct BitMap *BBL_AllocDBufBitMap( struct Screen * )
FUNCTION
Allocates a 2nd bitmap for the given screen with the same size,
depth and attributes (flags). At this time, it just calls
BBL_AllocBitMap(), but in the future, it may know how to deal
with graphic-cards.
INPUTS
screen - An open screen, for which the bitmap is for.
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
bitmap - Allocated and initialized BitMap or NULL, if the call failed.
SEE ALSO
BBL_InitDBuf(), BBL_ShowBitMap(), BBL_EndDBuf(), BBL_FreeBitMap()
blitzblank.library/BBL_AllocRastPort blitzblank.library/BBL_AllocRastPort
NAME
BBL_AllocRastPort -- Allocate a rastport.
SYNOPSIS
rastport = BBL_AllocRastPort( width, height, depth, flags )
D0 D1 D2 D3
struct RastPort *BBL_AllocRastPort( ULONG, ULONG, ULONG, ULONG )
FUNCTION
Allocates a rastport with the given width, height, depth and flags.
You will probably need this function in modules with doublebuffering
or hidden drawing. Actually, this function allocates a rastport and
then calls BBL_AllocBitMap().
INPUTS
width - Width of the rastport in pixels.
height - Height of the rastport in pixels.
depth - Number of planes in the rastport.
flags - BMF_CLEAR to specify that the allocated raster should be
filled with color 0.
BMF_DISPLAYABLE to specify that this bitmap data should
be allocated in such a manner that it can be displayed.
Displayable data has more severe alignment restrictions
than non-displayable data in some systems.
BMF_INTERLEAVED tells graphics that you would like your
bitmap to be allocated with one large chunk of display
memory for all bitplanes. This minimizes color flashing
on deep displays. If there is not enough contiguous RAM
for an interleaved bitmap, graphics.library will fall
back to a non-interleaved one.
RESULTS
rastport - Allocated and initialized RastPort or NULL, if the call failed.
SEE ALSO
BBL_FreeRastPort()
blitzblank.library/BBL_BlankDone blitzblank.library/BBL_BlankDone
NAME
BBL_BlankDone -- Tell BlitzBlank that blanking is finished.
SYNOPSIS
BBL_BlankDone()
void BBL_BlankDone( void )
FUNCTION
Signals BlitzBlank, that your Module is finished with the
blank()-function. The module must call it, after its blank()-function
returned. BlitzBlank will then close the blankscreen (if it opened
one).
INPUTS
RESULTS
SEE ALSO
All modules
blitzblank.library/BBL_BlankMouse blitzblank.library/BBL_BlankMouse
NAME
BBL_BlankMouse -- Blank the mouse on your own screen.
SYNOPSIS
window = BBL_BlankMouse( screen, mode )
A0 D0
struct Window *BBL_BlankMouse( struct Screen *, UBYTE )
FUNCTION
Opens a window on the screen at position (0,0).
The window is borderless. This window will be activated and the
mousepointer for this window will be made invisible -> The mouse
is blanked. Keep the result of this function for passing it
to BBL_UnBlankMouse() later. If you get a screen from BlitzBlank,
you will never need this function, because BlitzBlank will then
do the mouseblanking for you. Normally, you will use mode 0,
but if you want to have a RastPort with clipping to draw in, you
could use mode 1 for a fullscreen-window and use this window's
RastPort to draw in, instead of the screen's RastPort.
INPUTS
screen - Pointer to an open screen.
(It is safe, to pass a NULL here -> nothing will be done)
mode - 0 for small window (1x1), 1 for fullsize-window.
RESULTS
window - Keep this for use with BBL_UnBlankMouse().
SEE ALSO
BBL_UnBlankMouse(), BB.Tiles.c
blitzblank.lib/BBL_CloneFirstScreen blitzblank.lib/BBL_CloneFirstScreen
NAME
BBL_CloneFirstScreen -- Clone the first screen.
SYNOPSIS
screen = BBL_CloneFirstScreen( moredepth, flags )
D0 D1
struct Screen *BBL_CloneFirstScreen( UWORD, ULONG )
FUNCTION
Clones the first screen. That means it opens a screen with the same
dimensions, same colors and same contents. Normally, you won't need
this function, because you can get a cloned first screen by BlitzBlank
with the flag BBF_CloneScreen in BB_Message/flags. You only need this
function, if you decide at run-time, if you want a custom screen or a
cloned screen.
INPUTS
moredepth - If you want a deeper screen than the first screen then set
this to the number of additional bitplanes.
flags - BBF_Interleaved for an interleaved screen.
RESULTS
screen - Cloned first screen or NULL.
SEE ALSO
BB.Goats
blitzblank.library/BBL_CloseScreenSafe blitzblank.library/BBL_CloseScreenSafe
NAME
BBL_CloseScreenSafe -- Close a screen safely.
SYNOPSIS
BBL_CloseScreenSafe( screen )
A0
void BBL_CloseScreenSafe( struct Screen * )
FUNCTION
This function calls intuition's CloseScreen(). But if it can't close
the screen (because there are windows left open on it), it waits
until it really can close the screen. If you get the screen from
BlitzBlank, you will never need this function, because BlitzBlank
closes the screen for you (safely). But if you open the blankscreen
yourself, you should use this function to close it (after closing
all your own windows, of course), because there may be "visitor"-
windows from some nasty programs (eg ARQ, TrapDoor) on your
screen.
INPUTS
screen - Pointer to an open screen.
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
SEE ALSO
BB.Tiles.c
blitzblank.lib/BBL_CopyOriginalColors blitzblank.lib/BBL_CopyOriginalColors
NAME
BBL_CopyOriginalColors -- Copy the palette of the original screen.
SYNOPSIS
success = BBL_CopyOriginalColors( screen )
A0
BOOL BBL_CopyOriginalColors( struct Screen * )
FUNCTION
This function copies the palette of the original first screen to the
screen. It is only useful for screen-cloning modules, which want
to open their blankscreen on their own.
If you get your screen from BlitzBlank, you will never need this
function.
This function is V39-aware and knows how to copy colors with
256 levels of R, G, B.
INPUTS
screen - Pointer to an open screen.
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
success - TRUE if the copy was successful, otherwise FALSE.
SEE ALSO
BB.Tiles.c
blitzblank.lib/BBL_CopyOriginalScreen blitzblank.lib/BBL_CopyOriginalScreen
NAME
BBL_CopyOriginalScreen -- Copy the contents of the original screen.
SYNOPSIS
success = BBL_CopyOriginalScreen( screen )
A0
BOOL BBL_CopyOriginalScreen( struct Screen * )
FUNCTION
This function copies the contents of the original first screen to the
screen. It is only useful for screen-cloning modules, which want
to rebuild their blankscreen from time to time.
INPUTS
screen - Pointer to an open screen.
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
success - TRUE if the copy was successful, otherwise FALSE.
SEE ALSO
BB.Crumble.c, BB.Melt.c, BB.Mosaic.c, BB.Tiles.c
blitzblank.library/BBL_EndDBuf blitzblank.library/BBL_EndDBuf
NAME
BBL_EndDBuf -- Indicates the end of double-buffering.
SYNOPSIS
BBL_EndDBuf( handle )
A0
void BBL_EndDBuf( ULONG )
FUNCTION
Use this function at the end of your blank()-function to free all memory,
that was reserved by InitDBuf(). You should call BBL_ShowBitMap() with
the original bitmap, before calling this function. For an example of
how to use the library's double-buffering, look at the docs to
BBL_ShowBitMap().
INPUTS
handle - An internal handle, as returned by BBL_InitDBuf().
(It is safe, to pass a 0 here -> nothing will be done)
RESULTS
SEE ALSO
BBL_AllocDBufBitMap(), BBL_InitDBuf(), BBL_ShowBitMap(),
BB.AmigaSign.c, BB.Clock.c, BB.Spot.c
blitzblank.library/BBL_FadeDown blitzblank.library/BBL_FadeDown
NAME
BBL_FadeDown -- Reduce the brightness of a screen smoothly.
SYNOPSIS
success = BBL_FadeDown( screen, final, delay )
A0 D0 D1
BOOL BBL_FadeDown( struct Screen *, UBYTE, UBYTE )
FUNCTION
Reduces the brightness of the screen to final percent. It does a
smooth fadeout with a configurable delay.
This function is V39-aware and so will fade smoother, if V39 is
available.
INPUTS
screen - Pointer to an open screen.
(It is safe, to pass a NULL here -> nothing will be done)
final - remaining brightness in percent.
delay - 0 for immediate reduction, 1-20 for fading (20=extra slow).
RESULTS
success - FALSE, if CTRL-C was sent during the fading. If all
went well, it returns TRUE.
SEE ALSO
BB.Fade.c, BB.Melt.c, BB.Mosaic.c, BB.Crumble.c, BB.Tiles.c
blitzblank.library/BBL_FreeBitMap blitzblank.library/BBL_FreeBitMap
NAME
BBL_FreeBitMap -- Free a bitmap, that was allocated with
BBL_AllocBitMap() or BBL_AllocDBufBitMap().
SYNOPSIS
BBL_FreeBitMap( bitmap )
A0
void BBL_FreeBitMap( struct BitMap * )
FUNCTION
Frees all RAM allocated by BBL_AllocBitMap() or BBL_AllocDBufBitMap().
INPUTS
bitmap - Pointer to a bitmap, that was allocated with BBL_AllocBitMap()
or BBL_AllocDBufBitMap().
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
SEE ALSO
BBL_AllocBitMap(), BBL_AllocDBufBitMap(),
BB.AmigaSign.c, BB.Clock.c, BB.Spot.c
blitzblank.library/BBL_FreeRastPort blitzblank.library/BBL_FreeRastPort
NAME
BBL_FreeRastPort -- Free a rastport, that was allocated with
BBL_AllocRastPort().
SYNOPSIS
BBL_FreeRastPort( rastport )
A0
void BBL_FreeRastPort( struct RastPort * )
FUNCTION
Frees all RAM allocated by BBL_AllocRastPort().
INPUTS
rastport - Pointer to a rastport, that was allocated with
BBL_AllocRastPort().
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
SEE ALSO
BBL_AllocRastPort(), BB.Clock.c, BB.Spot.c
blitzblank.library/BBL_GetDarkestPen blitzblank.library/BBL_GetDarkestPen
NAME
BBL_GetDarkestPen -- Search for the darkest of a screen's colors.
SYNOPSIS
pen = BBL_GetDarkestPen( screen )
A0
LONG BBL_GetDarkestPen( struct Screen * )
FUNCTION
Scans the screen's colors and gives back the darkest color available.
This function is V39-aware and so will use the V39-function FindColor(),
if V39 is available.
INPUTS
screen - Pointer to an open screen.
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
pen - The pennumber of the darkest color.
SEE ALSO
BB.Crumble.c, BB.Melt.c
blitzblank.library/BBL_GetString blitzblank.library/BBL_GetString
NAME
BBL_GetString -- Get a localized string.
SYNOPSIS
resultstring = BBL_GetString( num, string )
D0 D1
STRPTR BBL_GetString( UWORD, STRPTR )
FUNCTION
If locale.library is available and it finds the locale string with number
num, then it returns a pointer to it. If something goes wrong, it just
returns the given string back.
INPUTS
num - number of the searched string.
string - default string (english).
RESULTS
resultstring - The searched string if it was found, otherwise the
given string.
SEE ALSO
All modules
blitzblank.library/BBL_InitDBuf blitzblank.library/BBL_InitDBuf
NAME
BBL_InitDBuf -- Initialize the library's double-buffering.
SYNOPSIS
handle = BBL_InitDBuf( screen, bitmap )
A0 A1
ULONG BBL_InitDBuf( struct Screen *, struct BitMap * )
FUNCTION
Initializes the library's double-buffering functions. Before you
can use BBL_ShowBitMap(), you MUST call this function. It will then
decide, which method of double-buffering will be used by
BBL_ShowBitMap(). If the system is running at least V39 and the
2 bitmaps (screen->RastPort.BitMap and bitmap) have the same
flags (BOTH interleaved ot BOTH non-interleaved), then the
double-buffering will be much faster. So, only request
an interleaved screen (and an interleaved bitmap) if you really
need them, because it is not sure, that the OS is able to
give them to you. If not, you could end up with an interleaved
screen and a non-interleaved bitmap. That would lead to
the slower double-buffering method. For an example of
how to use the library's double-buffering, look at the docs to
BBL_ShowBitMap().
INPUTS
screen - The screen, which will be double-buffered.
(It is safe, to pass a NULL here -> nothing will be done)
bitmap - The 2nd BitMap, which will be used for double-buffering.
It should be allocated with BBL_AllocDBufBitMap().
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
handle - An internal handle, which must be passed also to BBL_ShowBitMap()
and BBL_EndDBuf() or 0, if the call failed.
SEE ALSO
BBL_AllocDBufBitMap(), BBL_ShowBitMap(), BBL_EndDBuf(),
BB.AmigaSign.c, BB.Clock.c, BB.Spot.c
blitzblank.library/BBL_ModuleRunning blitzblank.library/BBL_ModuleRunning
NAME
BBL_ModuleRunning -- Tell BlitzBlank, that the module is running.
SYNOPSIS
BBL_ModuleRunning()
void BBL_ModuleRunning( void )
FUNCTION
This function indicates the start of the main-loop of the module. It
should be called right before the main-loop and right after a check
for CTRL-C and AFTER bringing your screen to the front!!!
At this time, the library will then set the user-defined task-priority
for the module.
INPUTS
RESULTS
SEE ALSO
All modules
blitzblank.library/BBL_RainbowPalette blitzblank.library/BBL_RainbowPalette
NAME
BBL_RainbowPalette -- Create a rainbow palette.
SYNOPSIS
BBL_RainbowPalette( screen, lowreg, highreg )
A0 D0 D1
void BBL_RainbowPalette( struct Screen *, ULONG, ULONG )
FUNCTION
Creates a rainbow-like palette for the given screen. Be careful: YOU
are responsible, that lowreg and highreg really exist in the ViewPort
of the screen. Also, highreg must be greater or equal lowreg.
Example (creates a complete rainbow palette, except color 0):
BBL_RainbowPalette (screeninfo->bbscreen,1,(1L<<screeninfo->depth)-1);
INPUTS
screen - Pointer to the screen.
(It is safe, to pass a NULL here -> nothing will be done)
lowreg - First color register to use.
highreg - Last color register to use.
RESULTS
SEE ALSO
BB.Lines.c
blitzblank.library/BBL_RemainingTime blitzblank.library/BBL_RemainingTime
NAME
BBL_RemainingTime -- Returns the remaining blank time.
SYNOPSIS
rem = BBL_RemainingTime()
ULONG BBL_RemainingTime( void )
FUNCTION
Tells you the remaining time in 1/50 seconds for your module. Of course this
only works, if BlitzBlank's Randomtime is greater than 0. If not, this
function returns always $ffffff. This function is useful, if you want to do
something in your module right BEFORE it gets the CTRL-C signal from
BlitzBlank, for example fading the screen to black.
INPUTS
RESULTS
rem = Remaining time in 1/50 seconds or $ffffff.
SEE ALSO
BB.Fountain, BB.Noise
blitzblank.library/BBL_ScreenAvailable blitzblank.library/BBL_ScreenAvailable
NAME
BBL_ScreenAvailable -- Checks the availability of a screen.
SYNOPSIS
success = BBL_ScreenAvailable( screen )
A0
BOOL BBL_ScreenAvailable( struct Screen * )
FUNCTION
Searches the screen-list for the given screen. This should be called,
before changing the screen's colormap (if you manipulate the first
screen directly like BB.Fade) or if you want to refresh the blankscreen
with the contents of the original first screen (like some screen-
cloning modules after a while do).
INPUTS
screen - Pointer to the searched screen.
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
success - If the screen was found, it returns TRUE. That means, the
screen is still open. Otherwise, it returns FALSE.
SEE ALSO
BB.Fade.c, BB.Melt.c, BB.Mosaic.c, BB.Crumble.c
blitzblank.library/BBL_SendMessage blitzblank.library/BBL_SendMessage
NAME
BBL_SendMessage -- Send the BB_Message to BlitzBlank.
SYNOPSIS
success = BBL_SendMessage( message, portname )
A0 D0
BOOL BBL_SendMessage( struct BB_Message *, STRPTR )
FUNCTION
Sends the initialized message to the portname. The portname is given
as argument #2 to the module. This function has to be called by
the module, after filling the message, in all 3 cases (BLANK, CONFIG,
INFO).
INPUTS
message - Pointer to a struct BB_Message.
portname - The portname from CLI-argument #2.
RESULTS
success - Returns TRUE if everything went well, otherwise returns FALSE.
If the result was TRUE, then all the GUI-objects and the
screeninfo are filled.
SEE ALSO
All modules
blitzblank.library/BBL_ShowBitMap blitzblank.library/BBL_ShowBitMap
NAME
BBL_ShowBitMap -- Show a bitmap in a screen (do double-buffering).
SYNOPSIS
BBL_ShowBitMap( screen, bitmap, handle )
A0 A1 A2
void BBL_ShowBitMap( struct Screen *, struct BitMap *, ULONG )
FUNCTION
Shows the bitmap at the next vertical blank. You must have called
BBL_InitDBuf() before you can use this function. Currently, it
knows two methods of double-buffering. Is uses them depending
on the OS-version and the flags of the screen and the bitmap
(see doc to BBL_InitDBuf()). The function itself waits for the
next vertical blank after changing the bitmap, so you don't have
to call WaitTOF() yourself.
NOTE: This function doesn't change the screen->RastPort.BitMap
pointer, so if you want to draw to the 2nd bitmap via a
rastport, you have to set this pointer to the drawing bitmap
by yourself.
Here is an example, of how to do double-buffering with this library
(without error-checking):
struct Screen *myscreen;
struct BitMap *bm[2];
int actual=1;
ULONG dbufhandle;
bm[0]=myscreen->RastPort.BitMap;
bm[1]=BBL_AllocDBufBitMap (myscreen);
dbufhandle=BBL_InitDBuf (myscreen,bm[1]);
myscreen->RastPort.BitMap=bm[actual];
loop
{
/* draw into bm[actual] or &myscreen->RastPort */
BBL_ShowBitMap (myscreen,bm[actual],dbufhandle);
actual=1-actual;
myscreen->RastPort.BitMap=bm[actual];
}
BBL_ShowBitMap (myscreen,bm[0],dbufhandle);
myscreen->RastPort.BitMap=bm[0];
BBL_EndDBuf (dbufhandle);
BBL_FreeBitMap (bm[1]);
INPUTS
screen - The screen, where the bitmap will be shown.
bitmap - The bitmap, that will be shown. You should allocate it with
BBL_AllocDBufBitMap().
handle - An internal handle, as returned by BBL_InitDBuf().
(It is safe, to pass a 0 here -> nothing will be done)
RESULTS
SEE ALSO
BBL_AllocDBufBitMap(), BBL_InitDBuf(), BBL_EndDBuf(),
BB.AmigaSign.c, BB.Clock.c, BB.Spot.c
blitzblank.library/BBL_UnBlankMouse blitzblank.library/BBL_UnBlankMouse
NAME
BBL_UnBlankMouse -- Unblank the mouse on your own screen.
SYNOPSIS
BBL_UnBlankMouse( window )
A0
void BBL_UnBlankMouse( struct Window * )
FUNCTION
Clears the pointer and closes the window, opened by BBL_BlankMouse().
If you get your screen from BlitzBlank, you will never need this
function.
INPUTS
window - Pointer to a window, as returned from BBL_BlankMouse().
(It is safe, to pass a NULL here -> nothing will be done)
RESULTS
SEE ALSO
BBL_BlankMouse(), BB.Tiles.c